import {JPGImage, PNGImage, GIFImage} from './Image';
import {WindowsPainter, LinuxPainter, UnixPainter} from './Painter';
import separator from '../patternSeparator';

separator('桥接模式');

let jpg = new JPGImage();
let png = new PNGImage();
let gif = new GIFImage();

let windows = new WindowsPainter();
let linux = new LinuxPainter();
let unix = new UnixPainter();


jpg.setPainter(windows);
jpg.parseFile('filename.jpg');

jpg.setPainter(linux);
jpg.parseFile('filename.jpg');

jpg.setPainter(unix);
jpg.parseFile('filename.jpg');

console.info('--------------');

png.setPainter(windows);
png.parseFile('filename.png');

png.setPainter(linux);
png.parseFile('filename.png');

png.setPainter(unix);
png.parseFile('filename.png');

console.info('--------------');

gif.setPainter(windows);
gif.parseFile('filename.gif');

gif.setPainter(linux);
gif.parseFile('filename.gif');

gif.setPainter(unix);
gif.parseFile('filename.gif');